package  
{
	import flash.display.MovieClip;
	import flash.display.Stage;
	import flash.events.Event;
	import Levels.Level1;
	import Objetos.Heroi;
	/**
	 * ...
	 * @author Rodrigo Forti
	 */
	public class Main extends MovieClip
	{
		private var MC_heroi:Heroi;
		private var levelState:String;
		private var LV_fase1:Level1;
		
		private static var _instance:	Main = null;
		
		public var MC_tela:MovieClip;
		
		public static function getInstance():Main 
		{ 
			return _instance; 
		}
		
        public static function getStage():Stage 
		{
			return getInstance().stage;
		}
		
		public function Main() 
		{
			_instance = this;
			iniciarJogo();
		}
		
		public function iniciarJogo():void
		{
			MC_tela = new MovieClip();
			addChild(MC_tela);
			
			levelState = "Level1";
			LV_fase1 = new Level1();
			addEventListener(Event.ENTER_FRAME, update, false, 0, true);
			
			desenharTela();
		}
		
		public function desenharTela():void
		{
			switch (levelState)
			{
				case "Level1":
					LV_fase1.desenharTela();
					LV_fase1.desenharArray();
					break;
					
				case "Level2":
					break;
			}
		}
		
		public function update(e:Event):void
		{
			switch (levelState)
			{
				case "Level1":
					LV_fase1.update();
					break;
					
				case "Level2":
					break;
			}
			
		}
		
	}

}